package com.yazi.mxz.common.entity.beans;

import com.myframework.smhj.hibernate.Entity;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * StoreMember entity. @author MyEclipse Persistence Tools
 */
@javax.persistence.Entity
@Table(name = "MXZ_STORE_MEMBER", schema = "MXZ")
public class StoreMember extends Entity implements java.io.Serializable {

	// Fields

	private StoreMemberId id;
	private Member member;
	private Store store;
	private Long addTime;
	private String pwd;
	private Long updateTime;

	// Constructors

	/** default constructor */
	public StoreMember() {
	}

	/** full constructor */
	public StoreMember(StoreMemberId id, Member member, Store store,
			Long addTime, String pwd, Long updateTime) {
		this.id = id;
		this.member = member;
		this.store = store;
		this.addTime = addTime;
		this.pwd = pwd;
		this.updateTime = updateTime;
	}

	// Property accessors
	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "memberId", column = @Column(name = "MEMBER_ID", nullable = false, precision = 15, scale = 0)),
			@AttributeOverride(name = "storeId", column = @Column(name = "STORE_ID", nullable = false, precision = 15, scale = 0)) })
	public StoreMemberId getId() {
		return this.id;
	}

	public void setId(StoreMemberId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "MEMBER_ID", nullable = false, insertable = false, updatable = false)
	public Member getMember() {
		return this.member;
	}

	public void setMember(Member member) {
		this.member = member;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "STORE_ID", nullable = false, insertable = false, updatable = false)
	public Store getStore() {
		return this.store;
	}

	public void setStore(Store store) {
		this.store = store;
	}

	@Column(name = "ADD_TIME", nullable = false, precision = 15, scale = 0)
	public Long getAddTime() {
		return this.addTime;
	}

	public void setAddTime(Long addTime) {
		this.addTime = addTime;
	}

	@Column(name = "PWD", nullable = false, length = 100)
	public String getPwd() {
		return this.pwd;
	}

	public void setPwd(String pwd) {
		this.pwd = pwd;
	}

	@Column(name = "UPDATE_TIME", nullable = false, precision = 15, scale = 0)
	public Long getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Long updateTime) {
		this.updateTime = updateTime;
	}

}